[20250213] BOJ / 골드4 / 문자열 생성 / 설진영 #109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/6137
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
주어진 문자 제일 앞 제일 뒤만 떼서 새로운 문자열을 만들 때,
사전 순으로 제일 앞에 있는 것 출력
🔍 풀이 방법
두포인터로 비교해가며 더 작은 것을 앞에 오도록 하면 된다. 단, 같은 문자일 경우 아무거나 출력하는 것이 아닌, 그 사이에서 또다른 두포인터를 통해 추후 더 작은것이 먼저 나올 수 있도록 처리하는 과정이 있어야 한다.
⏳ 회고
잘 풀어서 기분이 좋다.